/**
 * 计算滚屏位置
 * type 位置类型
 * screenHeight 屏幕高度
 * screenWidth  屏幕宽度
 */
export function getSSPosition(type, screenHeight, screenWidth) {
  // type = "中间";
  // screenHeight=1080;screenWidth=1920
  var width, height, top, left;
  switch (type) {
    case "中间":
      width = screenWidth;
      height = screenHeight * 2 / 3;
      top = screenHeight / 6;
      left = 0;
      break;
    case "全屏":
      width = screenWidth;
      height = screenHeight;
      top = 0;
      left = 0;
      break;
    case "中上":
      width = screenWidth;
      height = screenHeight / 2;
      top = 0;
      left = 0;
      break;
    case "中下":
      width = screenWidth;
      height = screenHeight / 2;
      top = screenHeight / 2;
      left = 0;
      break;
    case "左侧":
      width = screenWidth / 2;
      height = screenHeight;
      top = 0;
      left = 0;
      break;
    case "右侧":
      width = screenWidth / 2;
      height = screenHeight;
      top = 0;
      left = screenWidth / 2;
      break;
    case "左上侧":
      width = screenWidth / 2;
      height = screenHeight / 2;
      top = 0;
      left = 0;
      break;
    case "左下侧":
      width = screenWidth / 2;
      height = screenHeight / 2;
      top = screenHeight / 2;
      left = 0;
      break;
    case "右上侧":
      width = screenWidth / 2;
      height = screenHeight / 2;
      top = 0;
      left = screenWidth / 2;
      break;
    case "右下侧":
      width = screenWidth / 2;
      height = screenHeight / 2;
      top = screenHeight / 2;
      left = screenWidth / 2;
      break;
    case "左中":
      width = screenWidth / 2;
      height = screenHeight / 2;
      top = screenHeight / 4;
      left = 0;
      break;
    case "右中":
      width = screenWidth / 2;
      height = screenHeight / 2;
      top = screenHeight / 4;
      left = screenWidth / 2;
      break;
  }
  return {
    width,
    height,
    top,
    left
  }

}
/**
 * 计算聚合的位置
 * 宽高为固定值
 * type 位置类型
 * screenHeight 屏幕高度
 * screenWidth  屏幕宽度
 * ssPostion    滚屏位置
 * width        聚合宽度
 * height       聚合高度
 */
export function getAggrPostion(type, screenHeight, screenWidth, ssPostion, width, height) {
  var pHeight = ssPostion.height,
    pWidth = ssPostion.width,
    pTop = ssPostion.top,
    pLeft = ssPostion.left,
    top, left;
  // screenHeight = 1080,
  // screenWidth = 1920,
  // type = "默认",
  // width = 400,
  // height = 400
  switch (type) {
    case "默认":

      top = pTop - height;
      left = (screenWidth - width) / 2;
      break;
    case "上左":

      top = pTop - height;
      left = pLeft;
      break;
    case "上右":

      top = pTop - height;
      left = pLeft + pWidth - width;
      break;
    case "左上":

      top = pTop;
      left = pLeft - width;
      break;
    case "左中":

      top = pTop + (pHeight - height) / 2;
      left = pLeft - width;
      break;
    case "左下":

      top = pTop + (pHeight - height);
      left = pLeft - width;
      break;
    case "右上":

      top = pTop;
      left = pLeft + pWidth;
      break;
    case "右中":

      top = pTop + (pHeight - height) / 2;
      left = pLeft + pWidth;
      break;
    case "右下":

      top = pTop + (pHeight - height);
      left = pLeft + pWidth;
      break;
    case "下左":

      top = pTop + pHeight;
      left = left;
      break;
    case "下中":

      top = pTop + pHeight;
      left = (screenWidth - width) / 2;
      break;
    case "下右":
      top = pTop + pHeight;
      left = pLeft + pWidth - width;
      break;
  }
  return {
    top,
    left
  }
}


export const logoPosList = [{
    name: "左上",
    value: "topleft"
  },
  {
    name: "上",
    value: "top"
  },
  {
    name: "右上",
    value: "topright"
  },
  {
    name: "左",
    value: "left"
  },
  {
    name: "中",
    value: "center"
  },
  {
    name: "右",
    value: "right"
  },
  {
    name: "右下",
    value: "buttomright"
  },
  {
    name: "下",
    value: "bottom"
  },
  {
    name: "左下",
    value: "bottomleft"
  },
]